Verifying a Smart Contract
Verifying a smart contract increases transparency, and hence, trust.
Using the Torus Explorer
Steps to verify your deployed smart contract:
-
Click on Verify and publish
-
Choose Compiler Type (Single file is recommended)
-
Choose the compiler version (according to your contract)
-
Choose the open source license
-
Click continue
If you chose 'Single file' as the Compiler type, you could use a library like "sol-merger" to flatten your contract. It generates a single file that encompasses all the imports. Ensure there is only a single line of '// SPDX-License-Identifier'. If there are multiple lines of this, remove them, leaving only the first one.
-
Choose Optimization Yes (if you deployed your contract using Hardhat)
-
Paste the source code
-
If the contract has a constructor then you need to create the ABI code for the values passed to the constructor. Use https://abi.hashex.org/. Copy the result and paste it to the Argument (Constructor) section.
-
Tick the box to indicate that you are not a robot.
-
Verify and Publish